:root {
  --black: #343a40;
  --dark: #343a40;
  --white: #f8f9fa;
  --light: #f8f9fa;
  --cyan: #17a2b8;
  --info: #17a2b8;
  --green: #28a745;
  --success: #28a745;
  --yellow: #ffc107;
  --warning: #ffc107;
  --red: #dc3545;
  --danger: #dc3545;
  --purple: #007bff;
  --primary: #007bff;
  --grey: #6c757d;
  --secondary: #6c757d;
}

.text-overflow-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-overflow-2 {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-line-clamp: 2;
  -moz-line-clamp: 2;
  -webkit-box-pack: start;
  -moz-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.text-overflow-3 {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-line-clamp: 3;
  -moz-line-clamp: 3;
  -webkit-box-pack: start;
  -moz-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.text-wrap {
  /* word-break: break-all; */
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  white-space: -moz-pre-wrap;
  white-space: pre-wrap;
  /* 防止 flex 布局失效 */
  min-width: 0;
  min-height: 0;
}

.text-center {
  text-align: center;
}

.text-justify {
  text-align: justify;
  text-align-last: justify;
  word-break: break-all;
  word-wrap: break-word;
  white-space: pre-wrap;
  letter-spacing: -0.1em;
}

.text-right {
  text-align: right;
}

.force-text-nowrap {
  white-space: nowrap !important;
}

.force-text-break {
  word-break: break-all !important;
}

.img-cover {
  object-fit: cover;
  object-position: center;
}

.bg-cover {
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
}

.grid-bg-cover {
  background-color: #f8f9fa;
  background-image: linear-gradient(90deg, rgba(60, 10, 30, 0.05) 3%, transparent 0),
    linear-gradient(1turn, rgba(60, 10, 30, 0.05) 3%, transparent 0);
  background-size: 20px 20px;
  background-position: calc(50% - 10px) calc(50% - 10px);
  background-repeat: repeat;
}
[data-theme='dark'] .grid-bg-cover {
  background-color: #292a2e;
  background-image: linear-gradient(90deg, rgba(195, 245, 215, 0.05) 3%, transparent 0),
    linear-gradient(1turn, rgba(195, 245, 215, 0.05) 3%, transparent 0);
}

.display-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.display-flex {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
}

.display-evenly {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  align-content: space-evenly;
}

.text-black {
  color: var(--black);
}
.bg-black {
  background-color: var(--black);
}
.text-white {
  color: var(--white);
}
.bg-white {
  background-color: var(--white);
}
.text-cyan {
  color: var(--cyan);
}
.bg-cyan {
  background-color: var(--cyan);
}
.text-green {
  color: var(--green);
}
.bg-green {
  background-color: var(--green);
}
.text-yellow {
  color: var(--yellow);
}
.bg-yellow {
  background-color: var(--yellow);
}
.text-red {
  color: var(--red);
}
.bg-red {
  background-color: var(--red);
}
.text-purple {
  color: var(--purple);
}
.bg-purple {
  background-color: var(--purple);
}
.text-grey {
  color: var(--grey);
}
.bg-grey {
  background-color: var(--grey);
}

.brackets:not(:first-child)::before,
.square-brackets:not(:first-child)::before {
  margin-left: 0.25rem;
}

.brackets:not(:empty)::before {
  content: '(';
}

.brackets:not(:empty)::after {
  content: ')';
}

.square-brackets:not(:empty)::before {
  content: '[';
}

.square-brackets:not(:empty)::after {
  content: ']';
}

.empty-v:empty::after {
  content: '-';
}

.scroll-bold {
  ::-webkit-scrollbar {
    width: 0.6vw;
    height: 0.6vw;
    background-color: rgba(255, 255, 255, 0.1);
  }

  ::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 0.6rem rgba(0, 0, 0, 0.3);
    background-color: #888;
  }

  ::-webkit-scrollbar-track-piece {
    background-color: #999;
  }

  ::-webkit-scrollbar-thumb {
    -webkit-box-shadow: inset 0 0 0.6rem rgba(0, 0, 0, 0.3);
    background-color: #2f2f2f;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: #d2691e;
  }

  ::-webkit-scrollbar-button {
    width: 0;
    height: 0;
  }
}

.scroll-thin {
  ::-webkit-scrollbar {
    background-color: transparent;
    width: 0.3rem;
    height: 0.3rem;
  }

  ::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
  }

  ::-webkit-scrollbar-button {
    width: 0;
    height: 0;
  }
}

.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.dom-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.super-center {
  display: grid;
  place-items: center;
}

.disable-select {
  cursor: default;
  user-select: none; /* 标准语法 */
  -moz-user-select: none; /* Firefox */
  -webkit-user-select: none; /* Safari 和 Chrome */
  -ms-user-select: none; /* Internet Explorer/Edge */
  -webkit-touch-callout: none; /* 禁用长按链接呼出菜单（仅适用于移动设备） */
}

.disable-pointer {
  cursor: default;
  pointer-events: none;
  touch-action: none;
}

.disable-scroll {
  overflow: hidden !important;
}

.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

.m-auto {
  margin: auto;
}

.m-0 {
  margin: 0;
}

.p-auto {
  padding: auto;
}

.p-0 {
  padding: 0;
}

.bolder {
  font-weight: bolder;
}

.rounded {
  border-radius: 0.25rem;
}

.bordered {
  border: 1px solid var(--grey);
}

/* 让绝对定位的子元素 z-index 比父元素低 */
.overlay-child {
  transform-style: preserve-3d;
}
.overlay-child > .child {
  transform: translateZ(-1px);
}

/* 使用滤镜实现模糊效果 */
.blur {
  filter: blur(5px);
}

/* 灰白模式样式 */
.rip {
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
}

/* 应用黑暗模式到整个页面 */
.dark-mode {
  filter: invert(1) hue-rotate(180deg);
  -webkit-filter: invert(1) hue-rotate(180deg);
}
/* 应用黑暗模式到图片和视频元素 */
.dark-mode img,
.dark-mode video,
.dark-mode-exclude {
  filter: invert(1) hue-rotate(180deg);
  -webkit-filter: invert(1) hue-rotate(180deg);
}

/* 猫头鹰选择器用于选择所有具有前置兄弟元素的元素 */
.space * + * {
  margin: 0.25rem;
}
.zebra * + * {
  background-color: var(--grey);
}

.letter-spacing {
  letter-spacing: 2px;
}

.avoid-scroll-shake {
  scrollbar-gutter: stable;
}

.hide-scrollbar,
.hide-scrollbar *::-webkit-scrollbar,
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar,
.hide-scrollbar * {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.pointer {
  cursor: pointer;
}

.clickable {
  cursor: pointer;
}
.clickable:active {
  transform: scale(0.91);
  transition: all 0.35s;
  -webkit-transform: scale(0.91);
  -moz-transform: scale(0.91);
  -ms-transform: scale(0.91);
  -o-transform: scale(0.91);
  -webkit-transition: all 0.35s;
  -moz-transition: all 0.35s;
  -ms-transition: all 0.35s;
  -o-transition: all 0.35s;
}

.rotate360 {
  transition-property: all;
  transition-duration: 1.35s;
  transform: rotate(0deg);
}
.rotate360:hover {
  -webkit-transform: rotate(360deg);
  -moz-transform: rotate(360deg);
  -ms-transform: rotate(360deg);
  transform: rotate(360deg);
}

.rotate666 {
  transform: rotate(0turn);
  transition: transform 1s;
}
.rotate666:hover {
  animation: rotateAnimation 59s cubic-bezier(0.34, 0, 0.84, 1) 1s;
}
@keyframes rotateAnimation {
  0%,
  100% {
    transform: rotate(0turn);
  }
  50% {
    transform: rotate(666turn);
  }
}

.autocomplete-off,
input[autocomplete='off'] {
  -webkit-autofill: none; /* Chrome */
  -moz-box-shadow: 0 0 0px 1000px white inset !important; /* Firefox */
}

@media screen and (max-width: 768px) {
  /* 在小屏幕上隐藏某些元素 */
  .hide-on-mobile {
    display: none;
  }
}

.colorful-border {
  border-radius: 2.5px;
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(45deg, var(--colorful-border-start-color, #28a745), var(--colorful-border-end-color, #ff735a))
      border-box;
  border: 0.15rem solid transparent;
  -webkit-border-radius: 2.5px;
  -moz-border-radius: 2.5px;
  -ms-border-radius: 2.5px;
  -o-border-radius: 2.5px;
  transition: background-color 0.5s, border-color 0.5s;
}

ul.xxx-timeline {
  --timeline-color: #6c757d;
  --timeline-circle-color: #007bff;
  --timeline-hover-color: #ff735a;
  --timeline-circle-size: 12px;
  --timeline-width: 1px;
  --timeline-font-size: 1rem;

  list-style: none;
  padding: 0;
  margin: 0;
  margin-inline: auto;
  position: relative;

  li {
    position: relative;
    padding: 0.5rem 1.25rem;
    cursor: pointer;

    &:hover,
    &:active {
      &::before {
        border-color: var(--timeline-hover-color);
      }
    }
  }

  li::before {
    z-index: 1;
    cursor: pointer;
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: calc(var(--timeline-width) / 2);
    width: var(--timeline-circle-size);
    height: var(--timeline-circle-size);
    font-size: var(--timeline-circle-size);
    line-height: var(--timeline-circle-size);
    text-align: center;
    border-radius: 50%;
    border: var(--timeline-width) solid var(--timeline-circle-color);
    background-color: whitesmoke;
    color: transparent;
  }

  li::after {
    z-index: 0;
    cursor: default;
    content: '';
    position: absolute;
    top: 0;
    left: calc(var(--timeline-circle-size) / 2 + var(--timeline-width) / 2);
    width: var(--timeline-width);
    height: 100%;
    background-color: var(--timeline-color);
  }
}
